package com.example.demo.controller;

import com.example.demo.dto.vo.MailSendVo;
import com.example.demo.handler.IndexHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Description
 * @Author zhaobaolin
 * @Date 2018/10/26
 */
@Controller
public class IndexController {

    @Autowired
    private IndexHandler indexHandler;

    @RequestMapping("/index")
    @ResponseBody
    public String index(String addr) throws Exception
    {
        MailSendVo mailSendVo = indexHandler.index(addr);
        return null == mailSendVo ? "发送失败" : mailSendVo.toString();
    }
}
